package cn.kgm.enums;

public enum FactoryEnums {

    SHAPE("SHAPE", 1),
    COLOR("COLOR", 2),
    ;

    private Integer code;
    private String type;

    FactoryEnums(String type, Integer code) {
        this.code = code;
        this.type = type;
    }

    public static FactoryEnums getByType(String type) {
        for (FactoryEnums value : FactoryEnums.values()) {
            if (value.getType().equals(type))
                return value;
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getType() {
        return type;
    }
}
